// import { myId } from "./globalData";
let myId = 0;
class Card {
  id = myId++;
  name = "";
  image = "";
  attack = "";
  type = 1; /* 1攻击卡 2防御卡 3主动卡 4环境卡 5攻击卡+防御卡 */
  desc = "";
  tag = "";
  /**
   * @param {Card} card
   */
  constructor(card) {
    for (const key in card) {
      this[key] = card[key];
    }
    this._id = this.id;
  }
  get id() {
    return this._id;
  }
}

function randomNum(minValue, maxValue) {
  let randomValue =
    Math.floor(Math.random() * (maxValue - minValue + 1)) + minValue;
  return randomValue;
}
function randomCard(cardList) {
  let minValue = 0;
  let maxValue = cardList.length - 1;
  let randomValue =
    Math.floor(Math.random() * (maxValue - minValue + 1)) + minValue;
  return cardList[randomValue];
}
